package com.wiloon.java.network.network.nettyhttpserver.nettyhttpclient;


/**
 * Created by Roy on 2015/12/17;
 */
public class RequestExecutor implements Runnable {
    HttpClient httpClient;

    public RequestExecutor(HttpClient httpClient) {
        this.httpClient = httpClient;
    }

    public void run() {
        try {
            String host = "192.168";
            int port = 7000;
            String url = "http://" + host + ":" + port + "/?msg=";


            host = "192.168";
            port = 8080;
            url = "http://" + host + ":" + port + "/examples/servlets/servlet/HelloWorldExample";

            host = "192.168";
            host = "127.0.0.1";
            port = 7777;


            host = "127.0.0.1";
            port = 8080;
            url = "http://" + host + ":" + port + "/";

            host = "192.168";
            port = 8080;
            url = "http://" + host + ":" + port + "/";

            host = ConsoleParams.host;
            port = ConsoleParams.port;
            url = "http://" + host + ":" + port + ConsoleParams.urlSuffix;

            httpClient.connect(host, port, url);
            httpClient.sendRequest();
            httpClient.sync();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
